<?php

$configQuene = array('host' => 'localhost', 'port' => '5672', 'login' => 'guest', 'password' => 'guest');
$conn = new AMQPConnection($configQuene);

if ($conn->connect()) {
	$config = [
		'eqeueName' => 'wochacha_duiba',
	];
	$q_name = $config['eqeueName'];
	$channel = new AMQPChannel($conn);
	$q = new AMQPQueue($channel);
	$q->setName($q_name);
	$arr = $q->get();
	if (!$arr) return;
	$ack = $arr->getDeliveryTag();
	$res = $q->ack($ack);
	$msg = $arr->getBody();
	echo $msg . "\n";
	return 'ok';

} else {
	echo "Cannot connect to the broker \n ";
	exit(0);
}
